require("config")
require("utils")
require("pk")

setting = {}

local singNumberGame = 10

function setting.Init ()
    local ts = require("ts")
    local cjson = ts.json
    w,h = getScreenSize();
    MyTable = {
        ["style"]  = "default",
        ["rettype"] = "table",
        ["width"] = 600,
        ["height"] = 600,
        ["orient"] = "0",
        ["bgcolor"] = "255,255,255",
        ["btnbkcolor"] = "255,255,255",
        ["config"] = "",
        ["pagetype"] = "multi",
        ["selpage"] = "1",
        ["pagenumtype"] = "default",
        ["titles"] = "配置",
        ["timer"] = "0",
        ["cancelname"] = "取消",
        ["okname"] = "确定",
        ["titlealign"] = "left",
        ["titlesize"] = "15",
        pages=
        {
            {
                              
                {
                    ["type"] = "Label",
                    ["color"] = "38,38,38",
                    ["size"] = "15",
                    ["align"] = "left",
                    ["text"] = "单打pk",
                },
                {
                    ["type"] = "Edit",
                    ["color"] = "38,38,38",
                    ["prompt"] = "内容",
                    ["size"] = "15",
                    ["id"] = "numberGame",
                    ["align"] = "left",
                    ["text"] = "10",
                    ["kbtype"] = "number",
                    },},
        },
                  
    } 
    local MyJsonString = cjson.encode(MyTable);
    UIret,values = showUI(MyJsonString)
    if UIret == 1 and values then 
        local singNumberGame = values["numberGame"]
        local tabLists = {["numberGame"] =  singNumberGame}
        utils.setConfig(tabLists)
        toast("局数"..singNumberGame)
        pk.seePkI()
    end
end

return setting